<?php
$SEO['site_title'] .= seo(1)['site_title'];
$SEO['keyword'] .= seo(1)['keyword'];
$SEO['description'] .= seo(1)['description'];
$CATEGORYS = getcache('category_content_1','commons');
$MODEL = getcache('model','commons');
$modelid = 3;
?>
{template "content","header"}
<div class="layui-warp">
  <div id="masonry" class="container-fluid">
    {loop $datas $r}
    <div class="layui-box">
      <div class="layui-actions">
        <a class="layui-thumb" href="{$r[url]}" target="_blank"><img lay-src="{$r[thumb]}?x-oss-process=style/midpic" alt="{$r[title]}" /></a>
        <div class="layui-infos">
          {php $enjoynum = isset($r['digg']) ? $r['digg'] : 0;}
          <div class="layui-digg"><i class="layui-heart"></i><span class="layui-badge">{$enjoynum}人喜欢</span></div>
          <div class="layui-type"><i class="layui-icon">&#xe857;</i><span class="layui-badge"><a href="{$CATEGORYS[$r[catid]][url]}" target="_blank">{$CATEGORYS[$r[catid]][catname]}</a></span></div>
        </div>  
      </div>
      <div class="layui-stats">
        <div class="layui-tips">		
          {php $db = pc_base::load_model('content_model');$db->table_name = $db->db_tablepre.$MODEL[$modelid]['tablename'].'_data';$_r = $db->get_one(array('id'=>$r[id])); $pictureurls = $_r[pictureurls]; }
          {php $picnum = count(json_decode($pictureurls, true));}
          <div class="layui-piccount"><i class="layui-icon">&#xe64a;</i><span class="layui-badge layui-count" data-num="{$picnum}">{$picnum}P</span></div>
          <div class="layui-posttime"><i class="layui-icon">&#xe609;</i><span class="layui-badge layui-date">{date("Y-m-d", $r[inputtime])}</span></div>
        </div>
        <div class="layui-title">
          <h2><a href="{$r[url]}" title="{$r[title]}" target="_blank">{$r[title]}</a></h2>
        </div>
      </div>
    </div>
    {/loop}
  </div>
  <div class="layui-pagebox">
    <div class="layui-laypage">{$pages}</div>
  </div>
</div>
<script>
layui.use('flow', function(){
  var flow = layui.flow;
  flow.lazyimg(); 
});
</script>
{template "content","footer"}